Repository navigation
[SDK-873] iOS: install Iterable's iOS SDK through SPM (spm_dependency) - #947
Open
joaodordio wants to merge 5 commits into
Open
joaodordio wants to merge 5 commits into
joaodordio wants to merge 5 commits into
Conversation
CocoaPods trunk is read-only, so Iterable-iOS-SDK 6.7.5 is the last version published there. The podspec now uses React Native's spm_dependency helper (RN 0.75+) to add iterable-swift-sdk to the Pods project, still pinned to 6.7.5 exactly. RNIterableAPI.mm drops the unused IterableSDK.h import, which the Swift package does not ship. README, example README and CHANGELOG cover the migration.
|
Coverage Impact This PR will not change total coverage. Commit 154177c · 🚦 See full report on Qlty Cloud »🛟 Help
|
Xcode 16.4 passes the Swift package product IterableSDK.o to libtool twice (link file list and explicit input) for the static Iterable-React-Native-SDK pod, so the archive holds two copies and -ObjC makes the app link fail with duplicate IterableSDK symbols. Xcode 26.0 and later add it once. Move the build-ios and CodeQL Swift jobs to Xcode 26.0 and document Xcode 26+.
joaodordio
force-pushed
the
cursor/spm-dependency-ios-sdk-ad5a
branch
from
December 2, 2026 14:20
de05a5d to
bc34871
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Warning
Targets 4.1.0. 4.0.0 is published (npm
latest, tag4.0.0at221e1fd, the base of this PR) and still uses theIterable-iOS-SDK6.7.5 pod from CocoaPods trunk. 4.1.0 is the release that moves to SPM and Xcode 26. This is a breaking change shipped as a minor release by product decision. The CHANGELOG entry is under## Unreleased> Breaking changes; the release PR renames the heading and bumps the version, as usual. Ship it together with the Expo plugin release from iterable-expo-plugin#78, whose peer range^3.0.0 || ^4.0.0already covers 4.1.0.📝 Summary
🎟️ Jira Ticket: SDK-873
📖 Description
CocoaPods trunk went read-only on 2026-12-02, so
Iterable-iOS-SDK6.7.5 is the last version that will ever be published there. Every RN and Expo iOS app gets the native SDK through this podspec. Without this change RN can never pick up another iOS SDK release.What changed:
Iterable-React-Native-SDK.podspec:s.dependency "Iterable-iOS-SDK", "6.7.5"becomesspm_dependency(s, url: "https://github.com/Iterable/iterable-swift-sdk.git", requirement: { kind: "exactVersion", version: "6.7.5" }, products: ["IterableSDK"]). 6.7.5 is still the latest iOS SDK tag. The native version stays pinned exactly, the same as before and the same as the Flutter plugin (exact: "6.7.5"), so each RN release stays on a tested iOS SDK version.ios/RNIterableAPI/RNIterableAPI.mm: drop#import <IterableSDK/IterableSDK.h>. That was the pod's umbrella header, it only declared two unused version symbols, and SPM Swift targets don't ship it..github/workflows/ci.yml(build-ios) and.github/workflows/codeql.yml(Swift): Xcode 16.4 becomes Xcode 26.0 (see "Xcode 26+ is required" below)..gitignore: ignorePackage.resolved, the same policy asPodfile.lock.spm_dependencyships in React Native 0.75 and later (scripts/cocoapods/spm.rb, absent in 0.74). The remote URL code path is the same from 0.77.3 to 0.85.3. Our documented floor is already 0.77, so this adds no new constraint, and the peer range is unchanged.Not in this PR: Android 3.11.2 is now on Maven Central, but
android/build.gradlestill pins 3.10.1. Bump it separately if the next release should carry it.Customer migration in 4.1.0 (also in CHANGELOG under Unreleased > Breaking changes)
IterableSDK.oto libtool twice for the static RN pod (once through the link file list, once as an explicit input), so the archive holds two copies and-ObjCmakes the app link fail with duplicateIterableSDKsymbols. A CI probe of every Xcode on the macos-15 runner found:pod 'Iterable-iOS-SDK'from app targets. A leftover one fails the build withRedefinition of module 'IterableSDK'(verified), so it can't silently link a second copy.use_frameworks! :linkage => :dynamicis no longer required.pod installprints RN's[SPM] WARNING!!!about static linking unlessUSE_FRAMEWORKS=dynamic; on Xcode 26+ the SDK is linked once, so the warning doesn't apply.AppDelegate.mmfiles that#import <IterableSDK/IterableSDK-Swift.h>no longer compile, because that header only existed in the CocoaPods framework. Swift and plain ObjC.mwith@import IterableSDK;work.pod 'Iterable-iOS-AppExtensions'keeps building (verified) but stays on 6.7.5. Moving it to theIterableAppExtensionsSPM product needs a dependency rule that allows RN's pinned version, because Xcode resolves one version per workspace.ExpoAdapterIterablefails withno such module 'IterableSDK'.🧪 How to test?
cd example/ios && pod install && cd .. && yarn ios. The pod install output should include[SPM] Adding product dependency IterableSDK to Iterable-React-Native-SDK, and the package should resolve to 6.7.5.Verified locally on Xcode 27.2 (simulator, iOS 26.5 runtime):
Iterable.initializesucceeds, API calls go outuse_frameworks!staticuse_frameworks!dynamicuse_frameworks!dynamicimport IterableSDKOK, JS init OK.m@import IterableSDK;OKIn every case the app embeds
IterableSDK_IterableSDK.bundle(nibs, Core Data model, privacy manifest).CI on head
154177c0(CHANGELOG-only change since67e13952): every check passes except CodeQL Swift, which was still running when this was written. It passed on67e13952.build-ios(Xcode 26.0.1) did a real build with no turbo cache reuse: SPM was added to Pods, the app linked, and there were zero duplicate symbols. CodeQL Swift (Xcode 26.0.1) passes too. JS:yarn test(42 suites, 680 tests),yarn typecheckandyarn lintall pass.Not verified: a physical device, and rich push delivery to an NSE (the simulator can't authorize notifications without UI automation).
Overlap: open #881 edits the same CodeQL job in
codeql.yml, so expect a one-line conflict on whichever merges second.Unrelated pre-existing issue: the example app has no
UIApplicationSceneManifest, so it aborts at launch on the iOS 27 simulator (UIKit scene-lifecycle enforcement). It does this with or without this change.🧾 Changelog
Added under
## Unreleased> Breaking changes, for 4.1.0.📹 Loom recording if applicable
N/A
🐞 Github Issues solved
N/A
📚 Docs PR if applicable
iterable-docs#1659 (replaces #1658) documents RN SDK 4.1.0 and the Expo plugin Swift Package Manager setup on the RN install page. It covers the Xcode 26+ requirement, removing the
pod 'Iterable-iOS-SDK'lines, and moving the Notification Service Extension to theIterableAppExtensionsSPM product.